home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swagg_m.zip / MISC.SWG / 0012_REBOOT1.PAS.pas < prev    next >
Pascal/Delphi Source File  |  1993-05-28  |  1KB  |  49 lines

  1. { Subject: How to reboot With TP7.0 ??? }
  2. Var
  3.   hook : Word Absolute $0040:$0072;
  4.  
  5. Procedure Reboot(Cold : Boolean); Far;
  6. begin
  7.   if (Cold = True) then
  8.     hook := $0000
  9.   else
  10.     hook := $1234;
  11.  
  12.   ExitProc := ptr($FFFF,$0000);
  13. end;
  14.  
  15.  
  16. {
  17. P.S.  Note that it does not require any Units to compile.  Though
  18. depending on your Implementation, you may need to call HALT to
  19. trip the Exit code (which caUses a reboot).
  20. }
  21.  
  22. Program reset;
  23. Uses
  24.   Dos;
  25. Var
  26.   regs : Registers;
  27. begin
  28.   intr(25,regs);
  29. end.
  30.  
  31. { Yeah but it is easier to do it in Inline Asm
  32. eg:
  33. }
  34. Program reset;
  35. begin
  36.   Asm
  37.     INT 19h; {19h = 25 decimal}
  38.         end;
  39. end.
  40.  
  41. {
  42. One Word about this interupt is that it is the fastest reboot
  43. I know of but some memory managers, eg QEMM 6.03 don't like it,
  44. It will seriously hang Windows if called from a Dos Shell,
  45. Microsoft Mouse Driver 8.20 doesn't seem to like being run
  46. after you call int 19h and it was resident.
  47. Other than that it works like a gem!
  48. }
  49.